package com.eastrobot.report.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;
import com.eastrobot.report.db.DBdomain;
import com.eastrobot.report.model.Table;

/**
 * 生成sql入库
 * @author baoy
 *
 */
public class DisplayController extends BaseController {
	
	private  final Logger logger = LoggerFactory.getLogger(DisplayController.class);
	private static final long serialVersionUID = -2142705137239985126L;

	//主面板
	public String index(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		logger.info("跳转主面板！");
		return "view/index.jsp";
	}
	
	//组拼表及字段的属性结构
	public void TableTreeJson(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		List<Table> result = DBdomain.getInstance().getTableInfo();
		writeJson(resp, JSON.toJSONString(result));
	}
	

}
